package com.xsocket.study.clienthHandler;

import java.io.IOException;
import java.nio.BufferUnderflowException;
import java.nio.channels.ClosedChannelException;

import org.xsocket.MaxReadSizeExceededException;
import org.xsocket.connection.IDataHandler;
import org.xsocket.connection.INonBlockingConnection;

public class ClientHandler implements IDataHandler {
	
	public ClientHandler(){
		
	}

	@Override
	public boolean onData(INonBlockingConnection nbc) throws IOException,
			BufferUnderflowException, ClosedChannelException,
			MaxReadSizeExceededException {
		
		System.out.println("客户端dataHandlerk开始................ ");
		String res = nbc.readStringByDelimiter("\r\n");
		
		System.out.println("客户端dataHandler读到的数据:   " + res);
		
		return true;
	}

}
